<template>
  <div class="hello">
    <button @click="isShow=!isShow">显隐</button>
    <actionsheet v-model="isShow" :menus="menus" show-cancel @on-click-menu="click" @on-click-menu-menu1="clickMenu1"></actionsheet>
  </div>
</template>

<script>
import {Actionsheet} from 'vux'
//解构赋值
// import {minus,add} from './test.js'
export default {
  name: 'hello',
  data () {
    return {
      msg: 'Welcome to Your Vue.js App',
      isShow:false,
      menus:{
        'menu1':'发送给朋友',
        'menu2':'发送到朋友圈'
      }
    }
  },
  components:{
    Actionsheet
  },
  methods:{
    click(key){
      console.log('-----');
      console.log(key);
    },
    clickMenu1:function(){
      console.log('clickMenu1');
    }
  },
  created(){
    // console.log(he);
    // console.log(add(1,2));
    // console.log(minus(1,2));

    // const stu = {
    //   name :'lucy',
    //   age:20
    // }
    // const name = stu.name ;
    // const age = stu.age ;
    // 等价于上面的另一种写法：解构赋值 es6新内容
    // const {name,age} = stu ;
    // console.log(name);
    // console.log(age);
  }
}
</script>

<style scoped>
h1, h2 {
  font-weight: normal;
}

ul {
  list-style-type: none;
  padding: 0;
}

li {
  display: inline-block;
  margin: 0 10px;
}

a {
  color: #42b983;
}
</style>
